﻿'******************************* File Header *********************************
'* File Name:    WmiParameter.vb
'* Project:      WmiConnection
'* Copyright (c) Freddy Kuehne
'*
'* Default implementation for a wmi parameter.
'* 
'* This source is subject to the GNU Library General Public License (LGPL).
'* See http://wmiconnection.codeplex.com/license.
'* All other rights reserved.
'*****************************************************************************

''' <summary>
''' Default implementation for a wmi parameter.
''' </summary>
Public Class WmiParameter
  Inherits DbParameter
#Region "Constructors"
  ''' <summary>
  ''' Creates a new WmiParameter.
  ''' </summary> 
  Public Sub New()
    MyBase.New()
    ResetDbType()
  End Sub

  ''' <summary>
  ''' Creates a new WmiParameter.
  ''' </summary>
  ''' <param name="parameterName">Name of the parameter</param>
  ''' <param name="value">Value of the parameter</param>
  Public Sub New(parameterName As String, value As Object)
    Me.New()
    Me.ParameterName = parameterName
    Me.Value = value
  End Sub

  ''' <summary>
  ''' Creates a new WmiParameter.
  ''' </summary>
  ''' <param name="parameterName">Name of the parameter</param>
  ''' <param name="dbType">Type of the parameter value</param>
  ''' <param name="size">Size of the parameter value</param>
  Public Sub New(parameterName As String, dbType As DbType, size As Integer)
    Me.New(parameterName, Nothing)
    Me.DbType = dbType
    Me.Size = size
  End Sub
#End Region

#Region "DbParameter"
  ''' <summary>
  ''' <see cref="DbParameter.DbType"/>
  ''' </summary>
  Public Overrides Property DbType As DbType
  ''' <summary>
  ''' <see cref="DbParameter.Direction"/>
  ''' </summary>
  Public Overrides Property Direction As ParameterDirection = ParameterDirection.Input
  ''' <summary>
  ''' <see cref="DbParameter.IsNullable"/>
  ''' </summary>
  Public Overrides Property IsNullable As Boolean = True
  ''' <summary>
  ''' <see cref="DbParameter.ParameterName"/>
  ''' </summary>
  Public Overrides Property ParameterName As String
  ''' <summary>
  ''' <see cref="DbParameter.SourceColumn"/>
  ''' </summary>
  Public Overrides Property SourceColumn As String
  ''' <summary>
  ''' <see cref="DbParameter.SourceVersion"/>
  ''' </summary>
  Public Overrides Property SourceVersion As DataRowVersion = DataRowVersion.Default
  ''' <summary>
  ''' <see cref="DbParameter.Value"/>
  ''' </summary>
  Public Overrides Property Value As Object
  ''' <summary>
  ''' <see cref="DbParameter.Size"/>
  ''' </summary>
  Public Overrides Property Size As Integer
  ''' <summary>
  ''' <see cref="DbParameter.SourceColumnNullMapping"/>
  ''' </summary>
  Public Overrides Property SourceColumnNullMapping As Boolean = False

  ''' <summary>
  ''' <see cref="DbParameter.ResetDbType"/>
  ''' </summary>
  Public Overrides Sub ResetDbType()
    DbType = DbType.Object
  End Sub
#End Region
End Class
